<template>
  <div id="new_add_box">
    <div v-loading="loading">
      <div class="header">
        <div class="img">
          <img src="../../../assets/imgs/i2.png" alt="" />
        </div>
        <div class="name">采购结果维护信息</div>
        <div>
          <img src="../../../assets/imgs/i3.png" alt="" v-if="ruleForm_icon" />
          <img src="../../../assets/imgs/i4.png" alt="" v-if="!ruleForm_icon" />
        </div>
      </div>
      <div class="main">
        <el-form
          :model="ruleForm"
          :rules="rules"
          ref="ruleForm"
          label-width="143px"
          class="demo-ruleForm"
        >
          <el-row>
            <el-col :span="24">
              <el-form-item label="项目名称 :" prop="xxmc">
                <el-input
                  clearable
                  v-model="ruleForm.xxmc"
                  size="small"
                  placeholder="请输入项目名称"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="采购类别 :" prop="cglb">
                <el-cascader
                  :options="options_cglb"
                  clearable
                  :props="{ expandTrigger: 'hover' }"
                  v-model="ruleForm.cglb"
                  size="small"
                  @change="change_cascader_cglb"
                  placeholder="请选择采购类别"
                ></el-cascader>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="预算金额 :" prop="ysje">
                <el-input
                  clearable
                  v-model="ruleForm.ysje"
                  @change="change_ysje"
                  size="small"
                  placeholder="请输入预算金额"
                >
                  <i
                    slot="suffix"
                    style="
                      font-style: normal;
                      margin-right: 10px;
                      color: #606266;
                    "
                    >元</i
                  >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="合同类别 :" prop="htlb">
                <el-select
                  v-model="ruleForm.htlb"
                  size="small"
                  clearable
                  placeholder="请选择合同类别"
                >
                  <el-option
                    v-for="item in options_htlb"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="采购时间 :" prop="cgsj">
                <el-date-picker
                  v-model="ruleForm.cgsj"
                  size="small"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="请选择采购时间"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="合同金额 :" prop="cgje">
                <el-input
                  clearable
                  v-model="ruleForm.cgje"
                  size="small"
                  @change="change_cgje"
                  placeholder="请输入合同金额"
                >
                  <i
                    slot="suffix"
                    style="
                      font-style: normal;
                      margin-right: 10px;
                      color: #606266;
                    "
                    >元</i
                  >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="会议类型 :">
                <el-select
                  v-model="ruleForm.hylx"
                  size="small"
                  clearable=""
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in options_hylx"
                    :key="item.value"
                    :label="item.lxmc"
                    :value="item.lxid"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="单位名称 :" prop="dwmc">
                <el-input
                  clearable
                  v-model="ruleForm.dwmc"
                  size="small"
                  @change="change_dwmc"
                  placeholder="请输入单位名称"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="联系人 :" prop="lxr">
                <el-input
                  clearable
                  v-model="ruleForm.lxr"
                  size="small"
                  placeholder="请输入联系人"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="联系电话 :" prop="lxdh">
                <el-input
                  clearable
                  v-model="ruleForm.lxdh"
                  size="small"
                  placeholder="请输入联系电话"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="16">
              <el-form-item label="公司注册地址 :" prop="gszcdz">
                <el-input
                  clearable
                  v-model="ruleForm.gszcdz"
                  size="small"
                  placeholder="请输入公司注册地址"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item
                label="招标机构 :"
                :prop="ruleForm.zbjg == '' ? '' : 'zbjg'"
              >
                <el-input
                  clearable
                  v-model="ruleForm.zbjg"
                  size="small"
                  placeholder="请输入招标机构"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="招标机构联系人 :"
                :prop="ruleForm.zbjg == '' ? '' : 'zbjg'"
              >
                <el-input
                  clearable
                  v-model="ruleForm.zbjglxr"
                  size="small"
                  placeholder="请输入招标机构联系人"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="联系电话 :"
                :prop="ruleForm.zbjg == '' ? '' : 'zbjg'"
              >
                <el-input
                  clearable
                  v-model="ruleForm.zbjglxjg"
                  size="small"
                  placeholder="请输入招标机构联系电话"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <!-- <el-row>
          <el-col :span="16">
            <el-form-item label="议题 :">
              <el-input clearable
                        v-model="ruleForm.yt"
                        size='small'
                        placeholder="请输入议题"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="16">
            <el-form-item label="事项内容 :">
              <el-input clearable
                        v-model="ruleForm.sxlr"
                        size='small'
                        placeholder="请输入事项内容"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="16">
            <el-form-item label="汇报提纲 :">
              <el-input clearable
                        v-model="ruleForm.hbtg"
                        size='small'
                        placeholder="请输入汇报提纲"></el-input>
            </el-form-item>
          </el-col>
        </el-row> -->
        </el-form>
      </div>

      <div class="header" style="margin-top: 20px">
        <div class="img">
          <img src="../../../assets/imgs/i1.png" alt="" />
        </div>
        <div class="name">合同维护信息</div>
        <div>
          <img src="../../../assets/imgs/i3.png" alt="" v-if="ruleFormT_icon" />
          <img
            src="../../../assets/imgs/i4.png"
            alt=""
            v-if="!ruleFormT_icon"
          />
        </div>
      </div>
      <div class="main">
        <el-form
          :model="ruleFormT"
          :rules="rulesT"
          ref="ruleFormT"
          label-width="143px"
          class="demo-ruleForm"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="是否三方合同 :" prop="sfsfht">
                <el-select
                  v-model="ruleFormT.sfsfht"
                  size="small"
                  placeholder="请输入项目名称"
                >
                  <el-option
                    v-for="item in options_sfsfht"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="7" v-if="ruleFormT.sfsfht == 1">
              <el-form-item style="text-align: right">
                <el-button type="primary" size="small" @click="add_dsfList">
                  增 加
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>
          <div v-if="ruleFormT.sfsfht == 1">
            <div v-for="(i, k) in ruleFormT.sdsflist" :key="k">
              <el-row>
                <el-col :span="16">
                  <el-form-item
                    :label="'甲' + (k - 0 + 1) + ' :'"
                    :prop="'sdsflist.' + k + '.jfname'"
                    :rules="moreNotifyOjbectRules.sdsflist_input"
                  >
                    <el-input
                      clearable
                      v-model="i.jfname"
                      size="small"
                      placeholder="请输入第三方名称"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item
                    label="付款金额 :"
                    :prop="'sdsflist.' + k + '.amount'"
                    :rules="moreNotifyOjbectRules.sdsflist_amount"
                  >
                    <my-input-sum
                      clearable
                      v-model="i.amount"
                      size="small"
                      placeholder="请输入付款金额"
                    ></my-input-sum>
                  </el-form-item>
                </el-col>
                <el-col
                  :span="1"
                  v-if="ruleFormT.sdsflist.length - 0 > 2"
                  style="margin-top: 3px"
                >
                  <el-form-item label-width="10px">
                    <i
                      class="el-icon-close"
                      style="cursor: pointer; font-size: 20px"
                      @click.prevent="removeDomain(k, 'T')"
                    ></i>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </div>

          <el-row>
            <el-col :span="8">
              <el-form-item label="是否单价合同 :" prop="sfdjht">
                <el-select
                  v-model="ruleFormT.sfdjht"
                  size="small"
                  @change="danjiehtong"
                  placeholder=""
                >
                  <el-option
                    v-for="item in options_sfdjht"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
               <div v-if="ruleFormT.sfdjht !== '0'" style="padding-left: 45px">
                <el-col :span="8">
                  <el-form-item label="单价明细 :">
                    货物单价明细模板.xlsx
                    <span
                      class="frobox"
                      style="
                        color: #409eff;
                        margin-left: 20px;
                        cursor: pointer;
                        border-bottom: 1px solid #409eff;
                      "
                      @click="btn_xlsx"
                      >下载模板</span
                    >
                  </el-form-item>
                </el-col>
              </div>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="签订日期 :" prop="qdrq">
                <el-date-picker
                  v-model="ruleFormT.qdrq"
                  type="date"
                  value-format="yyyy-MM-dd"
                  clearable
                  size="small"
                  placeholder="请选择签订日期"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="有效开始时间 :" prop="yxkssj">
                <el-date-picker
                  v-model="ruleFormT.yxkssj"
                  type="date"
                  value-format="yyyy-MM-dd"
                  clearable
                  size="small"
                  :picker-options="pickerOptions1"
                  placeholder="请选择签订日期"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="合同结束时间 :" prop="htjssj">
                <el-date-picker
                  v-model="ruleFormT.htjssj"
                  type="date"
                  value-format="yyyy-MM-dd"
                  clearable
                  size="small"
                  @change="picker_change"
                  :picker-options="pickerOptions"
                  placeholder="请选择签订日期"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="开户行 :" prop="khh">
                <el-input
                  clearable
                  v-model="ruleFormT.khh"
                  size="small"
                  placeholder="请输入开户行"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="开户行账号 :" prop="khhzh">
                <el-input
                  clearable
                  v-model="ruleFormT.khhzh"
                  size="small"
                  placeholder="请输入开户行账号"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="">
                <div
                  style="
                    color: red;
                    font-size: 22px;
                    margin-left: -120px;
                    line-height: 40px;
                  "
                >
                  {{ ruleFormT.khhzh }}
                </div>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item label="到期是否提醒 :" prop="">
                <el-select
                  v-model="ruleFormT.dqsftx"
                  placeholder="请选择"
                  size="small"
                >
                  <el-option label="是" value="1"> </el-option>
                  <el-option label="否" value="0"> </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8" v-if="ruleFormT.dqsftx == '1'">
              <el-form-item label="提醒时长 : " prop="">
                <el-select v-model="ruleFormT.tqjy" size="small">
                  <el-option label="提前一月" value="1"> </el-option>
                  <el-option label="提前二月" value="2"> </el-option>
                  <el-option label="提前三月" value="3"> </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8" v-if="ruleFormT.dqsftx == '1'">
              <el-form-item label="到期备注 : " prop="">
                <el-select
                  clearable
                  filterable
                  allow-create
                  placeholder="请输入备注信息"
                  size="small"
                  v-model="ruleFormT.remarks"
                >
                  <el-option
                    v-for="item in contractname"
                    :key="item.cid"
                    :label="item.remarks1"
                    :value="item.remarks1"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
             <el-col :span="8">
                <el-form-item label="合同编号 : " prop="">
                <el-input
                  size="small"
                  clearable
                  placeholder="请输入合同编号信息"
                  v-model="ruleFormT.othernum"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="16">
              <el-form-item label="合同备注(临) : " prop="">
                <el-input
                  size="small"
                  type="textarea"
                  clearable
                  rows="1"
                  placeholder="请输入合同备注信息"
                  v-model="ruleFormT.contractremarks"
                >
                </el-input>
              </el-form-item>
            </el-col>
           
          </el-row>
          <el-row>
            <div class="fkjd">
              <div class="title">付款进度</div>
              <div class="btns">
                <el-button type="primary" size="small" @click="btn_add_fk(2)">
                  季度付款
                </el-button>
                <el-button type="primary" size="small" @click="btn_add_fk(1)">
                  月度付款
                </el-button>
                <el-button type="primary" size="small" @click="btn_add_fk(0)">
                  新增进度
                </el-button>
              </div>
              <div :class="ruleFormT.sfdjht == 0 ? 'kkjdxt1' : 'kkjdxt1'"></div>
            </div>
          </el-row>

          <el-row style="margin-top: 10px">
            <div>
              <div v-for="(i, k) in ruleFormT.payListEntity" :key="k">
                <el-row>
                  <el-col :span="3">
                    <el-form-item label-width="100px">
                      <div
                        style="width: 130px; color: #409eff; font-weight: 400"
                      >
                        第{{ k - 0 + 1 }}次付款
                      </div>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item
                      label="付款时间 :"
                      :prop="'payListEntity.' + k + '.planpaydate'"
                      :rules="moreNotifyOjbectRules.payListEntity_time"
                    >
                      <el-date-picker
                        v-model="i.planpaydate"
                        type="date"
                        value-format="yyyy-MM-dd"
                        clearable
                        size="small"
                        :picker-options="pickerOptions"
                        placeholder="请选择签订日期"
                      >
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item
                      label="付款金额 :"
                      :prop="'payListEntity.' + k + '.amount'"
                      :rules="moreNotifyOjbectRules.payListEntity_amount"
                    >
                      <el-input
                        clearable
                        v-model="i.amount"
                        @change="change_List_amount($event, k)"
                        size="small"
                        placeholder="请输入付款金额"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      label="付款比例 :"
                      :prop="'payListEntity.' + k + '.rate'"
                      :rules="moreNotifyOjbectRules.payListEntity_proportion"
                    >
                      {{ i.rate }} %
                    </el-form-item>
                  </el-col>
                  <el-col
                    :span="1"
                    v-if="ruleFormT.payListEntity.length - 0 > 1"
                    style="margin-top: 3px"
                  >
                    <el-form-item label-width="10px">
                      <i
                        class="el-icon-close"
                        style="cursor: pointer; font-size: 20px"
                        @click.prevent="removeDomain(k, 'S')"
                      ></i>
                    </el-form-item>
                  </el-col>
                </el-row>
              </div>
           
            </div>
          </el-row>
          <el-row>
            <el-col>
              <div
                style="
                  width: 100%;
                  background: #000000;
                  height: 2px;
                  margin-top: 20px;
                  opacity: 0.1;
                "
              ></div>
            </el-col>
          </el-row>
          <el-row>
            <el-col>
              <div class="scwj">
                <div>
                  <i
                    style="font-size: 30px; margin-top: 3px"
                    class="el-icon-upload"
                  ></i>
                </div>
                <div style="margin-left: 10px">上传文件</div>
              </div>
            </el-col>
          </el-row>
          <div class="file">
            <el-row>
              <div v-for="(i, k) in file_list" :key="k">
                <el-col
                  :span="17"
                  v-if="i.code !== 61"
                  :class="{ qtfj: i.code == 61 }"
                >
                  <div class="file_icon">
                    <img
                      class="icon_wj"
                      src="../../../assets/imgs/icon_wenjian.png"
                      alt=""
                    />
                    <div class="name">
                      <span style="color: red">*&nbsp;</span>{{ i.name }} :
                    </div>
                    <myUpload
                      v-model="ruleFormT.allFjEntityList[k]"
                      :drag="false"
                      :drag_download="true"
                      class="myupload"
                      accept=""
                    />
                  </div>
                </el-col>
                <el-col v-else class="qtfj" :span="7">
                  <div style="display: flex">
                    <img
                      class="icon_wj"
                      style="width: 20px"
                      src="../../../assets/imgs/icon_wenjian.png"
                      alt=""
                    />
                    <div class="title">
                      <span v-if="i.pass == 1" style="color: red">* </span>
                      &nbsp; {{ i.name }} ：
                    </div>
                  </div>
                  <myUpload
                    v-model="ruleFormT.allFjEntityList[k]"
                    :drag="true"
                    :drag_download="true"
                    class="myupload myupload_code_61"
                    accept=""
                  />
                </el-col>
              </div>
            </el-row>
            <el-row class="margins">
              <el-col
                style="padding: 0 20px 0px 20px; width: 71%; margin-top: 20px"
              >
                其他可上传附件：采购公告、采购结果公告确认表、计划备案表、采购评审专家抽取结果记录表，
                评审报告，评审结果确认函，成交公告，采购文件确认书，评审结果用户通知书，采购需求确认书，
                招标文件公告确认表，需求论证公告确认表，用户意见调查表，需求论证报告，竞争性磋商文件，
              </el-col>
            </el-row>
          </div>
        </el-form>
      </div>
      <div
        v-if="chcekEntityList.length - 0 > 0"
        style="margin: 0px 0; padding: 20px 0 0 0"
      >
        <div class="header" style="dispaly: flex">
          <div class="h_left header" style="margin-left: -5px">
            <div>
              <i class="el-icon-s-claim" style="font-size: 28px"></i>
            </div>
            <div class="h_title" style="margin: 0px 10px">历史审核意见</div>
            <div>
              <img src="../../../assets/imgs/i4.png" alt="" />
            </div>
          </div>
        </div>
        <div style="margin: 20px 0" class="reject">
          <el-form :model="ruleForm" label-width="130px" class="demo-ruleForm">
            <div v-for="(i, k) in chcekEntityList" :key="k" class="">
              <el-row :gutter="0" style="padding: 0px 0px">
                <el-col :span="8">
                  <el-form-item label="审核时间：" prop="">
                    {{ $moment(i.lastTime).format("YYYY-MM-DD HH:mm:ss") }}
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="审核状态：" prop="">
                    {{ i.state }}
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item
                    label="审核备注："
                    prop=""
                    v-if="i.state != '通过'"
                  >
                    {{ i.comment }}
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </el-form>
        </div>
      </div>
      <div>
        <el-dialog
          :title="gongshi_data.name"
          :visible.sync="gongshi_show"
          width="70%"
          center
          class="gsxx"
          append-to-body
          height="1000px"
        >
          <el-form
            label-width="110px"
            style="
              display: block;
              background: white;
              border-left: 5px solid white;
            "
            class="elasticframe my-search-form-box"
          >
            <el-row>
              <el-col :span="8">
                <el-form-item label="公司简称：">
                  <p>{{ gongshi_data.name }}</p>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="成立日期：">
                  <p>{{ gongshi_data.estiblishTime }}</p>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="注册号：">
                  <p>{{ gongshi_data.regNumber }}</p>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="注册资本：">
                  <p>{{ gongshi_data.regCapital }}</p>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="纳税人识别号：">
                  <p>{{ gongshi_data.taxNumber }}</p>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="人员规模：">
                  <p>{{ gongshi_data.staffNumRange }}</p>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="公司地址：">
                  <p>{{ gongshi_data.regLocation }}</p>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="经营范围：">
                  <p style="white-space: normal; word-break: break-all">
                    {{ gongshi_data.businessScope }}
                  </p>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="公司风险：">
                  <div style="display: flex">
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      自身风险
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      周边风险
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      预警风险
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      风险等级
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                        color: #409eff;
                        cursor: pointer;
                      "
                      @click="btn_gs_xq(gongshi_data)"
                    >
                      查看详情
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                        color: #409eff;
                        cursor: pointer;
                      "
                      @click="btn_gs_tyc(gongshi_data.tyId)"
                    >
                      天眼查查看
                    </div>
                  </div>
                  <div style="display: flex; color: red">
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      {{ gongshi_data.oneselfRisk }}
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      {{ gongshi_data.peripheralRisk }}
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      {{ gongshi_data.warning }}
                    </div>
                    <div
                      style="
                        margin-right: 25px;
                        width: 80px;
                        text-align: center;
                      "
                    >
                      {{ gongshi_data.riskLevel }}
                    </div>
                  </div>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="gongshi_show = false">取 消</el-button>
            <el-button type="primary" @click="gongshiqueding">确 定</el-button>
          </span>
        </el-dialog>

        <el-dialog
          :title="gongshi_data.name"
          :visible.sync="xiangqiangliebiao_tyc"
          width="70%"
          center
          class="gsxx"
          append-to-body
          height="1000px"
        >
          <el-table
            :data="gongshi_data.PartyInfoDto"
            stripe
            height="400"
            :header-row-style="{ color: '#656d92', fontSize: '14px' }"
            style="width: 100%"
          >
            <el-table-column type="index" align="center" width="100">
            </el-table-column>
            <el-table-column prop="name" align="center" label="风险归属">
            </el-table-column>
            <el-table-column prop="title" align="center" label="风险途径">
            </el-table-column>
            <el-table-column prop="tag" align="center" label="风险强度">
            </el-table-column>
            <el-table-column prop="total" align="center" label="风险总条数">
            </el-table-column>
          </el-table>
          <span slot="footer" class="dialog-footer">
            <el-button @click="xiangqiangliebiao_tyc = false">取 消</el-button>
            <el-button type="primary" @click="xiangqiangliebiao_tyc = false"
              >确 定</el-button
            >
          </span>
        </el-dialog>
      </div>
      <div class="btn">
        <el-button type="info" @click="cancel"> 取 消 </el-button>
        <el-button type="primary" @click="submitForm" :loading="btnloading_qd">
          保 存
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
import myUpload from '@/components/global/my-upload/main.vue'
export default {
  components: { myUpload },
  data() {
    return {
      contractname: [
        { remarks1: '合同续签', cid: 1, },
        { remarks1: '合同终止', cid: 2, },
      ], //合同名称
      btnloading_qd: false,
      zbjg_YZ: '',
      muban_as: '',
      chcekEntityList: [

      ],
      loading: false,
      getInfoData: {},
      xiangqiangliebiao_tyc: false,
      ruleForm_icon: true,
      ruleFormT_icon: true,
      cid: '',
      options_hylx: [],
      ruleForm: {
        hylx: '',
        isgovprocurement: '',
        classify: '',
        govprocurement: '',
        xxmc: '',
        cglb: [],
        ysje: '',
        htlb: '',
        cgsj: null,
        cgje: '',
        dwmc: '',
        lxr: '',
        lxdh: '',
        gszcdz: '',
        zbjg: '',
        zbjglxr: '', //招标机构联系人
        zbjglxjg: '',
        yt: '',
        sxlr: '',
        hbtg: '',

      },
      ruleFormT: {
        othernum:'',
        dqsftx: '0',
        contractremarks: "",
        remarks: '',
        tqjy: '1',
        allFjEntityList: [],
        fksj_jy: '季',
        payListEntity: [
          {
            planpaydate: null,
            amount: '',
            rate: '',
          },
        ],
        sdsflist: [
          { name: '甲', input: '', amount: '' },
          { name: '甲', input: '', amount: '' },
        ],

        sfsfht: '0',
        sfdjht: '0',
        qdrq: null,
        yxkssj: null,
        htjssj: null,
        khh: '',
        khhzh: '',
      },
      rules: {
        xxmc: [
          { required: true, message: '请输入项目名称', trigger: 'change' },
        ],
        zbjglxr: [
          {
            required: true,
            message: '请输入招标机构联系人',
            trigger: 'change',
          },
        ],
        zbjglxjg: [
          {
            required: true,
            message: '请输入招标机构联系电话',
            trigger: 'change',
          },
        ],
        hylx: [
          { required: true, message: '请选择会议类型', trigger: 'change' },
        ],
        cglb: [
          { required: true, message: '请选择采购类别', trigger: 'change' },
        ],
        ysje: [
          { required: true, message: '请输入预算金额', trigger: 'change' },
        ],
        htlb: [
          { required: true, message: '请输入合同类别', trigger: 'change' },
        ],
        cgsj: [
          { required: true, message: '请输入采购时间', trigger: 'change' },
        ],
        cgje: [
          { required: true, message: '请输入合同金额', trigger: 'change' },
        ],
        dwmc: [
          { required: true, message: '请输入单位名称', trigger: 'change' },
        ],
        lxr: [{ required: true, message: '请输入联系人', trigger: 'change' }],
        lxdh: [
          { required: true, message: '请输入联系电话', trigger: 'change' },
        ],
        gszcdz: [
          { required: true, message: '请输入公司注册地址', trigger: 'change' },
        ],
        zbjg: [
          { required: true, message: '请输入招标机构', trigger: 'change' },
        ],
      },
      moreNotifyOjbectRules: {
        sdsflist_input: [
          { required: true, message: '请输入第三方名称', trigger: 'change' },
        ],
        sdsflist_amount: [
          { required: true, message: '请输入第三方金额', trigger: 'change' },
        ],
        payListEntity_time: [
          { required: true, message: '请选择付款时间', trigger: 'change' },
        ],
        payListEntity_amount: [
          { required: true, message: '请输入付款金额', trigger: 'change' },
        ],
        payListEntity_proportion: [
          { required: true, message: ' ', trigger: 'change' },
        ],
      },
      rulesT: {
        sfsfht: [{ required: true, message: '', trigger: 'change' }],
        files: [{ required: true, message: '', trigger: 'change' }],
        sfdjht: [{ required: true, message: '', trigger: 'change' }],
        qdrq: [
          { required: true, message: '请选择签订日期', trigger: 'change' },
        ],
        djcfk: [{ required: true, message: '', trigger: 'change' }],
        yxkssj: [
          { required: true, message: '请选择有效开始时间', trigger: 'change' },
        ],
        htjssj: [
          { required: true, message: '请选择合同结束时间', trigger: 'change' },
        ],
        khh: [{ required: true, message: '请输入开户行', trigger: 'change' }],
        khhzh: [{ required: true, message: '开户行账号', trigger: 'change' }],
      },
      pickerOptions: {
        disabledDate: (time) => {
          return time.getTime() < new Date(this.ruleFormT.yxkssj).getTime()
        },
      },
      pickerOptions1: {

      },
      options_cglb: [
        {
          value: 'ziyuan',
          label: '资源',
          children: [
            {
              value: 'axure',
              label: 'Axure Components',
            },
            {
              value: 'sketch',
              label: 'Sketch Templates',
            },
            {
              value: 'jiaohu',
              label: '组件交互文档',
            },
          ],
        },
      ],
      options_htlb: [
        {
          value: '货物',
          label: '货物',
        },
        {
          value: '服务',
          label: '服务',
        },
        {
          value: '工程',
          label: '工程',
        },
      ],
      options_sfsfht: [
        { label: '是 / 三方合同', value: '1' },
        { label: '否 / 三方合同', value: '0' },
      ],
      options_sfdjht: [
        { label: '是 / 单价合同', value: '1' },
        { label: '否 / 单价合同', value: '0' },
      ],
      options_fksj_jy: [
        { label: '季度付款', value: '季' },
        { label: '月度付款', value: '月' },
      ],
      gongshi_data: [],
      gongshi_show: false,
      file_list: [],
    }
  },

  props: {
    list_details: {
      type: Object,
      default: '',
    },
  },

  async created() {
    await this.cglb_list_as()
    await this.hylxlist()
    console.log('传递过来的数据', this.list_details)
    if (this.list_details.cid) {
      await this.cid_t_axios()
    }
  },
  watch: {
    ruleForm: {
      handler(i) {
        var zbjgasd = false

        if (i.zbjg != '') {
          this.zbjg_YZ = 'zbjg'
        }
        if (i.zbjg == '' && i.zbjglxr == '' && i.zbjglxjg == '') {
          this.zbjg_YZ = null
          zbjgasd = true
        } else {
          zbjgasd = false
        }
        console.log(
          i.zbjg != '',
          i.zbjglxr != '',
          i.zbjglxjg != '',
          this.zbjg_YZ
        )
        if ((this.zbjg_YZ = 'zbjg')) {
          if (i.zbjg !== '' && i.zbjglxr !== '' && i.zbjglxjg !== '') {
            zbjgasd = true
          }
        } else {
          zbjgasd = false
        }
        if (
          i.xxmc != '' &&
          i.cglb.length - 0 != 0 &&
          i.ysje != '' &&
          i.htlb != '' &&
          i.cgsj != null &&
          i.cgje != '' &&
          i.dwmc != '' &&
          i.lxr != '' &&
          i.lxdh != '' &&
          i.gszcdz != '' &&
          zbjgasd
        ) {
          this.ruleForm_icon = false
        } else {
          this.ruleForm_icon = true
        }
      },
      deep: true,
    },
    ruleFormT: {
      handler(i) {
        console.log('watch 监听数据 ruleFormT', i)

        if (i.khhzh !== '') {
          this.ruleFormT.khhzh = i.khhzh
            .replace(/\s/g, '')
            .replace(/....(?!$)/g, '$& ')
        }

        let sanfanghetong = false
        if (i.sfsfht == 1) {
          i.sdsflist.forEach((a) => {
            if (a.amount != '' && a.jfname != '') {
              sanfanghetong = true
            } else {
              sanfanghetong = false
              return
            }
          })
        } else {
          sanfanghetong = true
        }

        let danjiahetong = false
        if (i.sfsfht == 1) {
          i.payListEntity.forEach((b) => {
            if (b.amount != '' && b.planpaydate != null) {
              danjiahetong = true
            } else {
              danjiahetong = false
              return
            }
          })
        } else {
          danjiahetong = true
        }


        let wenjian = false
        this.file_list.forEach((f, c) => {
          if (f.pass == 2 || f.pass == 1) {
            for (let aa in i.allFjEntityList) {
              if (aa == c) {
                if (i.allFjEntityList[aa].length - 0 > 0) {
                  console.log('you', aa, f)
                  wenjian = true
                } else {
                  console.log('meiyou', aa, f)
                  wenjian = false
                  return
                }
              }
              return
            }
          } else {

          }
        })
        if (
          sanfanghetong &&
          danjiahetong &&
          wenjian &&
          i.htjssj != null &&
          i.khh != '' &&
          i.khhzh != '' &&
          i.qdrq != null &&
          i.yxkssj != null
        ) {
          this.ruleFormT_icon = false
        } else {
          this.ruleFormT_icon = true
        }
      },
      deep: true,
    },
  },

  methods: {
    picker_change() {
      this.pickerOptions1 = {
        disabledDate: (time) => {
          return time.getTime() > new Date(this.ruleFormT.htjssj).getTime()
        },
      }
    },
    danjiehtong(e) {
      if (e == 0) {
        this.file_list.pop()
        this.ruleFormT.allFjEntityList.pop()
      } else {
        this.file_list.push({ name: '货物单价表', code: 1, pass: 1 })
        this.ruleForm.payListEntity = []
      }
    },
    btn_xlsx() {
      this.$axios.get('/info/contractVo/getFileDj').then((res) => {
        if (res) {
          this.$utils.$download(res.data.data[0].url, res.data.data[0].name)
        }
      })
    },
    hylxlist() {
      this.$axios.get('info/hylx/getList').then((rs) => {
        console.log(rs)
        this.options_hylx = []
        rs.data.data.forEach((a) => {
          if (a.lxzt == '启用') {
            this.options_hylx.push(a)
          }
        })
      })
    },
    btn_gs_xq(data) {
      console.log(data)
      this.xiangqiangliebiao_tyc = true
    },
    btn_gs_tyc(id) {
      window.open('https://www.tianyancha.com/company/' + id)
    },

    cid_t_axios() {
      this.$axios
        .get('/info/contractVo/getInfo/' + this.list_details.cid)
        .then((res) => {
          console.log('请求的数据', res)
          this.getInfoData = res.data.data

          this.cid = this.getInfoData.cid
          this.chcekEntityList = this.getInfoData.chcekEntityList.length - 0 > 0 ? this.getInfoData.chcekEntityList : []
          this.ruleForm.xxmc = this.getInfoData.projectname
          this.ruleForm.cglb = this.getInfoData.zfzcId
            ? this.getInfoData.zfzcId.split(',')
            : []
          console.log(this.ruleForm.cglb)
          this.ruleForm.ysje = this.formatMoney(this.getInfoData.budget)

          this.ruleForm.hylx = this.getInfoData.hylxId
          this.ruleForm.htlb = this.getInfoData.category
          this.ruleForm.cgsj = this.getInfoData.bidday
          this.ruleForm.cgje = this.formatMoney(this.getInfoData.amount)
          this.ruleForm.dwmc = this.getInfoData.winner
          this.ruleForm.lxr = this.getInfoData.concects
          this.ruleForm.lxdh = this.getInfoData.tel
          this.ruleForm.gszcdz = this.getInfoData.site
          this.ruleForm.zbjg = this.getInfoData.tenderee ? this.getInfoData.tenderee : ''
          this.ruleForm.zbjglxr = this.getInfoData.tendereeName ? this.getInfoData.tendereeName : ''
          this.ruleForm.zbjglxjg = this.getInfoData.tendereeTel ? this.getInfoData.tendereeTel : ''
          this.ruleFormT.sfsfht = this.getInfoData.sfdsf
          this.ruleFormT.sfdjht = this.getInfoData.isunitprice
          this.ruleFormT.qdrq = this.getInfoData.agentTime
          this.ruleFormT.yxkssj = this.getInfoData.startTime
          this.ruleFormT.htjssj = this.getInfoData.endTime
          this.ruleFormT.tqjy = this.getInfoData.remarks ? this.getInfoData.remarks.slice(this.getInfoData.remarks.length - 1) + '' : '1'
          this.ruleFormT.remarks = this.getInfoData.remarks ? this.getInfoData.remarks.slice(0, this.getInfoData.remarks.length - 2) : ''
          this.ruleFormT.contractremarks = this.getInfoData.contractremarks
          this.ruleFormT.othernum = this.getInfoData.othernum

          this.ruleFormT.khh = this.getInfoData.bank
          this.ruleFormT.dqsftx = this.getInfoData.remind ? this.getInfoData.remind : '1'

          this.ruleFormT.khhzh = this.getInfoData.bankaccount ? this.getInfoData.bankaccount : ''
          this.ruleForm.isgovprocurement = this.getInfoData.isgovprocurement
          this.ruleForm.classify = this.getInfoData.classify
          this.ruleForm.govprocurement = this.getInfoData.govprocurement

          console.log(
            this.file_list,
            this.ruleFormT.allFjEntityList,
            this.getInfoData.allFjEntityList
          )

          if (this.getInfoData.payListEntity.length - 0 > 0) {
            this.getInfoData.payListEntity.forEach((am) => {
              am.amount = this.formatMoney(am.amount)
            })
            this.ruleFormT.payListEntity = this.getInfoData.payListEntity
          } else {
            this.ruleFormT.payListEntity = [
              {
                planpaydate: null,
                amount: '',
                rate: '',
              },
            ]
          }
          if (this.getInfoData.dsfdomains.length - 0 > 0) {
            this.ruleFormT.sdsflist = this.getInfoData.dsfdomains
          } else {
            this.ruleFormT.sdsflist = [
              { name: '甲', input: '', amount: '' },
              { name: '甲', input: '', amount: '' },
            ]
          }
          this.cglb_list_as()
        })
    },

    cglb_list_as() {
      this.$axios.get('other/external/getPolicyList').then((res) => {
        console.log(res)
        if (res.data.data) {
          this.options_cglb = res.data.data
          console.log(this.ruleForm)
          if (this.ruleForm.cglb) {
            this.file_list_axios(this.ruleForm.isgovprocurement)
            return
          } else {
            this.ruleForm.cglb = [
              res.data.data[0].value,
              res.data.data[0].children[0].value,
            ]
          }
        }
      })
    },

    btn_add_fk(e) {
      let payListEntity_num = this.ruleFormT.payListEntity.length - 0

      if (e == 0) {
        this.ruleFormT.payListEntity.push({
          planpaydate: null,
          amount: '',
          rate: '',
        })
      }
      if (e == 1) {
        if (this.ruleFormT.yxkssj == null && this.ruleFormT.htjssj == null) {
          for (let i = 0; i < 12 - payListEntity_num; i++) {
            this.ruleFormT.payListEntity.push({
              planpaydate: null,
              amount: '',
              rate: '',
            })
          }
        } else {
          var num0 = this.ruleFormT.yxkssj.split('-')
          var num1 = this.ruleFormT.htjssj.split('-')
          console.log(
            (parseInt(num1[0]) - parseInt(num0[0])) * 12,
            parseInt(num1[1]) - parseInt(num0[1])
          )
          var num =
            (parseInt(num1[0]) - parseInt(num0[0])) * 12 +
            (parseInt(num1[1]) - parseInt(num0[1]))

          if (num == 0) {
            num = 1
          }
          if (this.ruleFormT.payListEntity.length - 0 > num) {
            this.ruleFormT.payListEntity.splice(num)
          } else {
            for (let s = 0; s < num - payListEntity_num; s++) {
              this.ruleFormT.payListEntity.push({
                planpaydate: null,
                amount: '',
                rate: '',
              })
            }
          }
        }
        return
      }
      if (e == 2) {
        if (this.ruleFormT.yxkssj == null && this.ruleFormT.htjssj == null) {
          for (let i = 0; i < 4 - payListEntity_num; i++) {
            this.ruleFormT.payListEntity.push({
              planpaydate: null,
              amount: '',
              rate: '',
            })
          }
        } else {
          var num0 = this.ruleFormT.yxkssj.split('-')
          var num1 = this.ruleFormT.htjssj.split('-')
          console.log(
            (parseInt(num1[0]) - parseInt(num0[0])) * 12,
            parseInt(num1[1]) - parseInt(num0[1])
          )
          var num =
            ((parseInt(num1[0]) - parseInt(num0[0])) * 12 +
              (parseInt(num1[1]) - parseInt(num0[1]))) / 3
          num = Math.ceil(num)
          console.log('num', num, num1, num0);
          if (num == 0) {
            num = 1
          }
          if (this.ruleFormT.payListEntity.length - 0 > num) {
            this.ruleFormT.payListEntity.splice(num)
          } else {
            for (let s = 0; s < num - payListEntity_num; s++) {
              this.ruleFormT.payListEntity.push({
                planpaydate: null,
                amount: '',
                rate: '',
              })
            }
          }
        }
        return
      }
    },

    add_dsfList() {
      this.ruleFormT.sdsflist.push({
        jfname: '',
        amount: '',
        cid: this.cid,
      })
    },

    removeDomain(e, k) {
      console.log(e, k)
      if (k == 'T') {
        this.ruleFormT.sdsflist.splice(e, 1)
        return
      }
      if (k == 'S') {
        this.ruleFormT.payListEntity.splice(e, 1)
        return
      }
    },

    file_list_axios(e) {
      if (e == '') {
        return
      }
      this.$axios.get('/info/contractVo/getFjInfo/' + e).then((res) => {
        if (res) {
          this.file_list = res.data.data
          if (this.ruleFormT.sfdjht == 1) {
            this.file_list.push({ name: '货物单价表', code: 1, pass: 1 })
          }
          if (this.getInfoData.allFjEntityList) {
            var flise = this.getInfoData.allFjEntityList
            this.ruleFormT.allFjEntityList = []
            console.log(this.file_list)
            for (let nm in this.file_list) {
              let Files = []
              for (let jk in flise) {
                if (flise[jk].type - 0 == this.file_list[nm].code - 0) {
                  console.log(jk)
                  Files.push(flise[jk])
                  this.ruleFormT.allFjEntityList[nm - 0] = Files
                  console.log(this.ruleFormT.allFjEntityList)
                }
              }
            }

            console.log(this.ruleFormT.allFjEntityList)

          }
        }
      })
    },

    change_cascader_cglb(e) {
      console.log(e)
      this.options_cglb.forEach((i) => {
        if (i.value == e[0]) {
          i.children.forEach((p) => {
            if (p.value == e[1]) {
              console.log(p.label)
              this.file_list_axios(p.label)
            }
          })
        }
        console.log(1111)
      })
      if (e.length - 0 == 0) {
        this.file_list_axios()
        console.log(2222)
      }
    },

    cancel() {
      console.log(this.$parent.$parent)

      this.$parent.$parent.apigetTableData_new()
      this.$router.push({
        query: {}
      })
      this.$parent.$parent.dialogVisibleadd_2 = false
    },
    format(time) {
      //shijianchuo是整数，否则要parseInt转换
      var time = new Date(time);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      if (m < 10) {
        m = '0' + m
      }
      if (d < 10) {
        d = '0' + d
      }
      return y + '-' + m + '-' + d
    },

    submitForm() {
      if (this.ruleForm.xxmc == '') {
        this.$message.error('请输入项目名称')
        return
      } else {
        console.log(this.ruleForm.zbjg, this.ruleForm.zbjglxr, this.ruleForm.zbjglxjg);

        let zbjgTF = false
        if (this.ruleForm.zbjg != '' || this.ruleForm.zbjglxr != '' || this.ruleForm.zbjglxjg != '') {
          if (this.ruleForm.zbjg != '' && this.ruleForm.zbjglxr != '' && this.ruleForm.zbjglxjg != '') {
            zbjgTF = true
          } else {
            zbjgTF = false
          }
        }
        if (this.ruleForm.zbjg == '' && this.ruleForm.zbjglxr == '' && this.ruleForm.zbjglxjg == '') {
          zbjgTF = true
        }

        if (!zbjgTF) {
          this.$message.error('请输入招标机构全部信息')
          return
        }

        let allFjEntityList = []
        if (this.ruleFormT.allFjEntityList.length - 0 > 0) {
          for (let yu in this.ruleFormT.allFjEntityList) {
            this.ruleFormT.allFjEntityList[yu].forEach((res) => {
              if (res.name) {
                res.type = this.file_list[yu].code
                allFjEntityList.push(res)
              }
            })
          }
        }
        let payListEntitys = []
        console.log(this.ruleFormT.sfdjht, this.ruleFormT.payListEntity)
        let za = 0
        let af = false

        if (this.ruleFormT.payListEntity.length - 0 > 0) {
          this.ruleFormT.payListEntity.forEach((data, index) => {
            console.log(data.amount)
            if (data.amount) {
              za = za + this.$utils.$moneyToNumValue(data.amount)
              payListEntitys.push({
                amount: this.$utils.$moneyToNumValue(data.amount),
                cid: this.cid,
                planpaydate: data.planpaydate,
                rate: data.rate,
                stage: '第' + (index - 0 + 1) + '付款',


              })
            }
          })
        }
        if (za != this.ruleForm.cgje) {
          af = true
        }
        if (this.$utils.$moneyToNumValue(this.ruleForm.ysje) < this.$utils.$moneyToNumValue(this.ruleForm.cgje)) {
          this.$message.error('合同金额不能大于预算金额')
          return
        }

        let dsfdomains = []
        if (this.ruleFormT.sfsfht == 1) {
          console.log(this.ruleFormT.sdsflist)
          if (this.ruleFormT.sdsflist.length - 0 > 0) {
            this.ruleFormT.sdsflist.forEach((data) => {
              dsfdomains.push({
                jfname: data.jfname,
                amount: this.$utils.$moneyToNumValue(data.amount),
                cid: this.cid,
              })
            })
          }
        }
        let classify = ''
        this.options_cglb.forEach((i) => {
          if (i.value == this.ruleForm.cglb[0]) {
            i.children.forEach((p) => {
              if (p.value == this.ruleForm.cglb[1]) {
                classify = p.label
              }
            })
          }
        })
        console.log(this.ruleForm.cglb.toString())
        var lxmc = ''
        this.options_hylx.forEach((a) => {
          if (a.lxid == this.ruleForm.hylx) {
            lxmc = a.lxmc
          }
        })
        let remind_time = ''
        if (this.ruleFormT.dqsftx == '1') {
          remind_time = this.format(new Date(this.ruleFormT.htjssj).getTime() - this.ruleFormT.tqjy * 1000 * 60 * 60 * 24 * 30)
          console.log(remind_time);
        }
        let post_data = {
          contractremarks: this.ruleFormT.contractremarks,
          remarks: this.ruleFormT.remarks + '-' + this.ruleFormT.tqjy,
          remind: this.ruleFormT.dqsftx,
          remind_time: remind_time,
          projectname: this.ruleForm.xxmc,
          govprocurement: classify,
          budget: this.$utils.$moneyToNumValue(this.ruleForm.ysje),
          category: this.ruleForm.htlb,
          bidday: this.ruleForm.cgsj,
          amount: this.$utils.$moneyToNumValue(this.ruleForm.cgje),

          hymc: lxmc,
          hylxId: this.ruleForm.hylx,

          winner: this.ruleForm.dwmc,
          concects: this.ruleForm.lxr,
          tel: this.ruleForm.lxdh,
          site: this.ruleForm.gszcdz,
          tenderee: this.ruleForm.zbjg,
          tendereeName: this.ruleForm.zbjglxr,
          tendereeTel: this.ruleForm.zbjglxjg,
          sfdsf: this.ruleFormT.sfsfht, //是否第三方
          isunitprice: this.ruleFormT.sfdjht, //是否单价合同
          agentTime: this.ruleFormT.qdrq, //签订日期
          startTime: this.ruleFormT.yxkssj, //合同开始时间
          endTime: this.ruleFormT.htjssj, //合同结束时间
          othernum:this.ruleFormT.othernum,
          bank: this.ruleFormT.khh,
          bankaccount: this.ruleFormT.khhzh,
          allFjEntityList: allFjEntityList,
          payListEntity: payListEntitys,
          dsfdomains: dsfdomains,
          zfzcId: this.ruleForm.cglb.toString(),




          zbtzsFiles: [],
          pfbFiles: [],
          agentFiles: [],


          notification: '',
          tbYtid: '',


          smjFiles: [],
          spdFiles: [],
          babFiles: [],
          unitPriceFiles: [],
          reportCycle: this.ruleFormT.fksj_jy,
          classify: classify,
          isgovprocurement: classify,
          issueId: '',
          ytCid: '',
          cid: this.cid,
          supplementList: [],
          issue: '',
        }
        this.loading = true
        console.log('保存参数数据：', post_data)

        this.axios_Forms(post_data)
      }


















    },

    axios_Forms(e) {
      this.btnloading_qd = true
      this.$axios.post('/info/contractVo/doSaveOrUpdate', e).then((res) => {
        console.log(res.data.data)
        if (res.data.data) {
          this.loading = false
          this.$message({
            message: '保存成功',
            type: 'success',
          })
          this.btnloading_qd = false
          this.btn_loading = false
          this.cancel()
        } else {
          this.$nextTick(() => {
            setTimeout(() => {
              this.btnloading_qd = false
              this.btn_loading = false
              this.loading = false
            }, 300)
          })
        }
      })
    },

    change_ysje(e) {
      console.log(e)
      this.ruleForm.ysje = this.formatMoney(e)
      if (e - 0 == 0) {
        this.ruleForm.ysje = ''
      }
    },

    change_cgje(e) {
      console.log(e)
      this.ruleForm.cgje = this.formatMoney(e)
      if (e - 0 == 0) {
        this.ruleForm.cgje = ''
        return
      }
      this.ruleFormT.payListEntity.forEach((res) => {
        if (res.amount != '' || res.amount != 0) {
          res.rate =
            Math.round((this.$utils.$moneyToNumValue(res.amount)) / this.$utils.$moneyToNumValue(this.ruleForm.cgje) * 100)
        }
      })
    },

    change_List_amount(e, k) {
      e = e.replace(',')
      console.log(e, k, this.$utils.$moneyToNumValue(this.ruleForm.cgje))
      if (this.ruleForm.cgje == '' || this.ruleForm.cgje == 0) {
        return
      }

      if (
        this.ruleFormT.payListEntity[k].amount == '' ||
        this.ruleFormT.payListEntity[k].amount == 0
      ) {
        this.ruleFormT.payListEntity[k].rate = 0
        return
      }
      this.ruleFormT.payListEntity[k].amount = this.formatMoney(
        this.ruleFormT.payListEntity[k].amount
      )
      console.log(this.formatMoney(this.ruleFormT.payListEntity[k].amount))
      this.ruleFormT.payListEntity[k].rate = Math.round(
        (this.$utils.$moneyToNumValue(this.ruleFormT.payListEntity[k].amount) / this.$utils.$moneyToNumValue(this.ruleForm.cgje)) * 100
      )
    },

    change_dwmc(e) {
      console.log(e)
      if (e != '') {
        this.$axios
          .post('/info/contractCom/getCompanyInfo?name=' + e)
          .then((res) => {
            console.log(res)
            if (res.data.data) {
              this.gongshi_show = true
              this.gongshi_data = res.data.data
            }
          })
      }
    },

    gongshiqueding() {
      this.gongshi_show = false
      this.ruleForm.dwmc = this.gongshi_data.name
      this.ruleForm.lxr = this.gongshi_data.legalPersonName

      this.ruleForm.gszcdz = this.gongshi_data.regLocation
    },

    formatMoney(number, decimals = 2) {
      let num = parseFloat(number).toFixed(decimals)
      num = num.toString().replace(/\$|\,/g, '')
      if (isNaN(num)) {
        num = '0'
      }
      let sign = num == (num = Math.abs(num))
      num = Math.floor(num * 100 + 0.50000000001)
      let cents = num % 100
      num = Math.floor(num / 100).toString()
      if (cents < 10) {
        cents = '0' + cents
      }
      for (let i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) {
        num =
          num.substring(0, num.length - (4 * i + 3)) +
          ',' +
          num.substring(num.length - (4 * i + 3))
      }
      return (sign ? '' : '-') + num + '.' + cents
    },
  },
}
</script>

<style lang='scss' scoped>
#new_add_box {
  width: calc(100% - 38px);
  padding: 25px 30px 30px;
  height: 100%;
  overflow-y: auto;

  .reject {
    font-family: "Microsoft YaHei", "\5FAE\8F6F\96C5\9ED1", "SimHei";
    font-size: 14px;
    border-radius: 10px;
    padding: 15px 30px;
    box-shadow: 0px 1px 7px 0px rgba(77, 71, 83, 0.2);
  }
 ::v-deep .el-form {
    .el-cascader {
      width: 100%;
    }
    .el-date-editor {
      width: 100%;
    }
    .el-select {
      width: 100%;
      .el-input__suffix {
        height: 100%;
        margin-top: -3px;
      }
    }
    .el-form-item__error {
      margin-left: 1px;
    }
  }
  .header {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-family: Microsoft YaHei, Microsoft YaHei-Regular;
    font-weight: bold;
    color: #409eff;
    .name {
      margin: -3px 12px 0;
    }
  }
  .main {
    .scwj {
      display: flex;
      align-items: center;
      font-size: 18px;
      font-family: Microsoft YaHei, Microsoft YaHei-Regular;
      font-weight: bold;
      color: #409eff;
      margin-top: 20px;
      line-height: 30px;
    }
    .fkjd {
      .title {
        font-size: 18px;
        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
        font-weight: bold;
        color: #409eff;
        margin-right: 50px;
      }
      margin-top: 15px;
      display: flex;
      align-items: center;

      .kkjdxt1 {
        margin-left: 40px;
        width: calc(100% - 430px);
        background: #000000;
        height: 2px;
        opacity: 0.1;
      }
      .kkjdxt2 {
        width: calc(100% - 130px);
        background: #000000;
        height: 2px;
        opacity: 0.1;
      }
    }
    margin-top: 20px;
    max-width: 100%;

    border-radius: 10px;
    background: #fff;
    padding: 20px;
    box-shadow: 0px 1px 7px 0px rgba(77, 71, 83, 0.2);
  }
  .btn {
    position: fixed;
    top: 80px;
    right: 48px;
    z-index: 99;
  }
  .file {
    width: 100%;
    margin-bottom: 20px;
    min-height: 300px;
    .qtfj {
      position: absolute;
      box-shadow: 0px 1px 7px 0px rgba(77, 71, 83, 0.2);
      right: -15px;
      top: 10px;
      padding: 20px 30px;
      border-radius: 10px;
      min-height: 300px;
      height: calc(100% - 10px);
      overflow-y: auto;
      overflow-x: hidden;
      .title {
        display: flex;
      }
      .myupload_code_61 {
        margin-top: 20px;
        width: 100%;
       ::v-deep.my-upload {
          .el-upload {
            width: 100%;
          }
          width: 100%;
          justify-content: center;
          .el-upload-dragger {
            width: 90%;
            margin-left: calc(5% + 10px);
          }
        }
      }
    }
    .file_icon {
     ::v-deep .el-form-item {
        display: flex;
        align-items: center;
        .el-form-item__label {
          height: 100%;
        }
        .el-form-item__content {
          height: 100%;
          margin-left: 0 !important;
        }
        width: 100%;
        height: 100%;
      }
     ::v-deep .myupload {
        margin-left: 20px;
        display: flex;
        align-items: center;
        position: relative;
        min-height: 30px;
        width: 100%;
        .my-upload {
          margin-bottom: 0 !important;
        }
        .el-row--flex {
          position: absolute;
          right: 0;
        }
        .el-button--text {
          padding-bottom: 0;
        }
        .my-upload-info {
          width: calc(100% - 125px);
          .info_item {
            margin: 3px 0;
          }
        }
      }
      .name {
        width: 150px;
        text-align: right;
        overflow: hidden;
      }
      margin-top: 10px;
      box-shadow: 0px 1px 7px 0px rgba(77, 71, 83, 0.2);
      display: flex;
      border-radius: 5px;
      min-height: 30px;
      padding: 10px 5px 10px 25px;
      align-items: center;
      .icon_wj {
        width: 20px;
      }
    }
  }
}
.gsxx {
  overflow: auto;
  .elasticframe {
   ::v-deep .el-row {
      margin-top: 15px;
    }
  }
 ::v-deep.el-dialog__footer {
    text-align: right;
  }
}
</style>